﻿<cfsilent>
	<cfscript>
	
		dictAdvice = getProperty("serviceFactory").getBean("senateDictionaryAdvice");
		datetimeAdvice = getProperty("serviceFactory").getBean("datetimeAdvice");

		event.setArg("pageTitle", "教学运行管理 - 考试安排 - 学院课程考试安排");
		
		termId = event.getArg("TermID");
		depId = event.getArg("DepID","101");

		academicYear = event.getArg("AcademicYear");
		academicTerm = event.getArg("AcademicTerm");
		
		currentTab = event.getArg("TabID", "labToArrange");
		
		targetArgs = structNew();
		structInsert(targetArgs, "DepID", depId);
		
		passArgs = structNew();
		structInsert(passArgs, "InstituteID", depId);
		structInsert(passArgs, "TermID", termId);
		
		passDelArgs = structNew();
		structInsert(passDelArgs, "InstituteID", depId);
		
		/* 学院所有可以提前考试课程 */
		sql = "SELECT 
				   t_course.course_name, 
				  t_course.course_credit, 
				 (SELECT COUNT(*) FROM t_student_course a WHERE a.task_id = t_task.tsk_id) countEX,
				  t_course.cid ,t_task.tsk_id ,
				  t_teacher.tch_name,
				  (SELECT t_new_examtaskAdvice.is_arranged from t_new_examtaskAdvice where t_new_examtaskAdvice.task_id = t_task.tsk_id ) isArranged 
			  FROM 
				  t_task  
				  INNER JOIN t_course ON t_course.cid = t_task.cid 
				  INNER JOIN t_teacher ON t_teacher.tch_id = t_task.tch_id  
			  WHERE 
				  t_task.term_id = :termId 
				  AND 
				  t_task.task_period is not null 
			  ORDER BY 
				isArranged, t_course.prop_id,t_course.course_name";
					
		queryObj = new query( datasource=application.dnsSlave );
		queryObj.addParam( name="termId", value=termId, cfsqltype="cf_sql_char" );
		
		rs_courseAll = queryObj.execute( sql=sql ).getResult();
		
		
		/* 学院尚未安排考试课程设置 */
		sql = "SELECT 
					t_task.task_classes,
				   t_course.course_name, 
				  t_course.course_credit, 
				 (SELECT COUNT(*) FROM t_student_course a WHERE a.task_id = t_task.tsk_id) countEX,
				  t_course.cid ,t_course.prop_id, t_task.tsk_id ,
				  t_teacher.tch_name,
				   (SELECT t_new_examtask.is_arranged from t_new_examtask where t_new_examtask.task_id = t_task.tsk_id ) isArranged  
			  FROM 
				  t_task  
				  INNER JOIN t_course ON t_course.cid = t_task.cid 
				  INNER JOIN t_teacher ON t_teacher.tch_id = t_task.tch_id  
			  WHERE 
				  t_task.term_id = :termId 
				  AND NOT EXISTs(
				  	SELECT 1 from t_new_examtask where t_new_examtask.task_id = t_task.tsk_id and t_new_examtask.is_arranged = '3'
				  )
				  AND 
				  t_task.task_period is not null 
			  ORDER BY 
				 isArranged,t_course.prop_id, t_course.course_name";
					
		queryObj = new query( datasource=application.dnsSlave );
		queryObj.addParam( name="termId", value=termId, cfsqltype="cf_sql_char" );
		
		rs_courseToDo = queryObj.execute( sql=sql ).getResult();
		
	
		/*期末考试任务*/
		sql = "select a.*, c.tch_name, d.cid, d.course_name,d.course_credit,e.classroom,b.task_chooesd 
				from t_new_examtask a 
				INNER JOIN t_task b on b.tsk_id = a.task_id 
				INNER JOIN t_teacher c ON c.tch_id = b.tch_id 
				INNER JOIN t_course d ON d.cid = b.cid 
				INNER JOIN t_classroom e ON e.cr_id = a.cr_id 
				where a.is_arranged = '3' 
			     AND b.term_id = :termId 
				order by e.classroom, a.date_exam, a.time_start"; 
		
		queryObj = new query( datasource=application.dnsSlave );
		
		queryObj.addParam( name="termId", value=termId, cfsqltype="cf_sql_char" );
		
		rs_examTask = queryObj.execute( sql=sql ).getResult();
		
		
		/*期末提前考试任务*/
		sql = "select a.is_arranged,a.*, c.tch_name, d.course_name,d.course_credit,e.classroom,b.task_chooesd, 
					(select count(*) from t_new_examadvice_student s where s.task_id = a.task_id) count 
				from t_new_examtaskAdvice a 
				INNER JOIN t_task b on b.tsk_id = a.task_id 
				INNER JOIN t_teacher c ON c.tch_id = b.tch_id 
				INNER JOIN t_course d ON d.cid = b.cid 
				INNER JOIN t_classroom e ON e.cr_id = a.cr_id 
				where a.is_arranged = '3' 
			     AND b.term_id = :termId 
				order by e.classroom, a.date_exam, a.time_start"; 
		
		queryObj = new query( datasource=application.dnsSlave );
		
		queryObj.addParam( name="termId", value=termId, cfsqltype="cf_sql_char" );
		
		rs_examTaskAdvice = queryObj.execute( sql=sql ).getResult();
	
		/* 更新显示标签逻辑 */
		if ( currentTab eq "labToArrange" and rs_courseToDo.recordCount eq 0  ) {
			currentTab = "labDoneArrange";
		}

		if ( currentTab eq "labToArrange" and rs_courseToDo.recordCount eq 0 and rs_courseDone.recordCount gt 0 ) {
			currentTab = "labDoneArrange";
		}
		
		if (currentTab eq "labDoneArrange" AND rs_examTask.recordCount eq 0 and rs_examTaskAdvice.recordCount eq 0){
			currentTab = "labAdviceArrange";
		}
		
		
		adviceKeywords = trim(event.getArg("adviceKeywords"));
		
		if( len(adviceKeywords) ){
			
			sql = "SELECT 
					   t_course.course_name, 
					  t_course.course_credit, 
					 (SELECT COUNT(*) FROM t_student_course a WHERE a.task_id = t_task.tsk_id) countEX,
					  t_course.cid ,t_task.tsk_id ,
					  t_teacher.tch_name,
					  (SELECT t_new_examtaskAdvice.is_arranged from t_new_examtaskAdvice where t_new_examtaskAdvice.task_id = t_task.tsk_id ) isArranged 
				  FROM 
					  t_task  
					  INNER JOIN t_course ON t_course.cid = t_task.cid 
					  INNER JOIN t_teacher ON t_teacher.tch_id = t_task.tch_id  
				  WHERE 
					  t_task.term_id = :termId 
					  AND 
					 ( t_course.course_name like (:keyword) OR t_teacher.tch_name like (:keyword))
				  ORDER BY 
					isArranged, t_course.course_name";
						
			queryObj = new query( datasource=application.dnsSlave );
			queryObj.addParam( name="termId", value=termId, cfsqltype="cf_sql_char" );
			queryObj.addParam( name="keyword", value="%" & adviceKeywords & "%", cfsqltype="cf_sql_varchar" );
			
			rs_courseAll = queryObj.execute( sql=sql ).getResult();
		}
		
		classNames = "";
		
		for( i=1; i lte rs_courseToDo.recordCount; i++){
			classNames = classNames & "," &  rs_courseToDo["task_classes"][i];
		}
		
		/*查询班级*/
		sql = "SELECT cls_id, cls_name from t_class where substr(grade,3,3) = :termId and (:classNemes) like '%' || cls_name || '%' order by cls_name";
		
		queryObj = new Query( datasource=application.dnsSlave);
		
		queryObj.addParam( name="termId",value=termId, cfsqltype="cf_sql_char" );
		queryObj.addParam( name="classNemes",value=classNames, cfsqltype="cf_sql_varchar");
		
		rs_class = queryObj.execute( sql=sql ).getResult();
		
		Keyword = trim(event.getArg("Keywords"));
		className = event.getArg("CLASS");
		
		if( len(Keyword) and (not len(className))){
			sql = "SELECT 
					   t_course.course_name, 
					  t_course.course_credit, 
					 (SELECT COUNT(*) FROM t_student_course a WHERE a.task_id = t_task.tsk_id) countEX,
					  t_course.cid ,t_course.prop_id,t_task.tsk_id ,
					  t_teacher.tch_name,
					   (SELECT t_new_examtask.is_arranged from t_new_examtask where t_new_examtask.task_id = t_task.tsk_id ) isArranged  
				  FROM 
					  t_task  
					  INNER JOIN t_course ON t_course.cid = t_task.cid 
					  INNER JOIN t_teacher ON t_teacher.tch_id = t_task.tch_id  
				  WHERE 
					  t_task.term_id = :termId 
					  AND NOT EXISTs(
						SELECT 1 from t_new_examtask where t_new_examtask.task_id = t_task.tsk_id and t_new_examtask.is_arranged = '3'
					  ) 
					  AND 
					 ( t_course.course_name like (:keyword) OR t_teacher.tch_name like (:keyword))
				  ORDER BY 
					 isArranged,t_course.prop_id, t_course.course_name";
						
			queryObj = new query( datasource=application.dnsSlave );
			queryObj.addParam( name="termId", value=termId, cfsqltype="cf_sql_char" );
			queryObj.addParam( name="keyword", value="%" & Keyword & "%", cfsqltype="cf_sql_varchar" );
			
			rs_courseToDo = queryObj.execute( sql=sql ).getResult();
		}
		
		if( len(className) ){
			
			Keyword = "";
			
			sql = "SELECT 
					   t_course.course_name, 
					  t_course.course_credit, 
					 (SELECT COUNT(*) FROM t_student_course a WHERE a.task_id = t_task.tsk_id) countEX,
					  t_course.cid ,t_course.prop_id, t_task.tsk_id ,
					  t_teacher.tch_name,
					   (SELECT t_new_examtask.is_arranged from t_new_examtask where t_new_examtask.task_id = t_task.tsk_id ) isArranged  
				  FROM 
					  t_task  
					  INNER JOIN t_course ON t_course.cid = t_task.cid 
					  INNER JOIN t_teacher ON t_teacher.tch_id = t_task.tch_id  
				  WHERE 
					  t_task.term_id = :termId 
					  AND NOT EXISTs(
						SELECT 1 from t_new_examtask where t_new_examtask.task_id = t_task.tsk_id and t_new_examtask.is_arranged = '3'
					  ) 
					  AND
					  t_task.task_classes like (:className) 
				  ORDER BY 
					 isArranged,t_course.prop_id, t_course.course_name";
						
			queryObj = new query( datasource=application.dnsSlave );
			queryObj.addParam( name="termId", value=termId, cfsqltype="cf_sql_char" );
			queryObj.addParam( name="className", value="%" & className & "%", cfsqltype="cf_sql_varchar" );
			
			rs_courseToDo = queryObj.execute( sql=sql ).getResult();
		}

	</cfscript>
</cfsilent>

<div id="headArea">
	<div class="uiHeader uiHeaderWithImage ptm">
		<div class="clearfix uiHeaderTop">
			<div class="uiHeaderActions rfloat">
				<a class="uiButton" href="<cfoutput>#buildURL('examPlan')#</cfoutput>"><i class="mrs img btnList"></i><span class="uiButtonText">考试课程设置</span></a>
			</div>
			<div>
				<h2 class="uiHeaderTitle">
					<i class="uiHeaderImage img icon16x16 campus"></i>学院课程考试安排
				</h2>
			</div>
		</div>
	</div>
</div>

<div class="UIElement">
	<ul class="senateFirstPage">
		<li>
			<div class="clearfix">
			
				<div class="UItab">
					<div class="tabLables">
						<span <cfif currentTab eq "labToArrange">class="active"</cfif> id="labToArrange" tabTarget="ToArrange">尚未安排</span>
						
						<cfif rs_examTask.recordCount >
							<span <cfif currentTab eq "labDoneArrange">class="active"</cfif> id="labDoneArrange" tabTarget="DoneArrange">考试安排详情</span>
						</cfif>
                              
                              
                              <span <cfif currentTab eq "labAdviceArrange">class="active"</cfif> id="labAdviceArrange" tabTarget="AdviceArrange">提前考试安排</span>
                              
                              <cfif rs_examTaskAdvice.recordCount>
							<span <cfif currentTab eq "labDoneArrangeAdvice">class="active"</cfif> id="labDoneArrangeAdvice" tabTarget="DoneArrangeAdvice">提前考试安排详情</span>
						</cfif>
					</div>
				</div>
				<script language="javascript" type="text/javascript">
					//<![CDATA[
					<!--
					$(document).ready(function() {
						
						/* init Tab */
						$("div.tabContent").hide();
						$("div#" + $("div.tabLables span.active").attr("tabTarget")).show();
						
						$("div.tabLables > span").click(function(){
							var $targetID = $(this).attr("tabTarget");
							
							$("div.tabLables span").removeClass("active");
							$(this).addClass("active");
							
							$("div.tabContent").not('[id="' + $targetID + '"]').hide();
							$("div.tabContent#" + $targetID).show();
						});
						
					});
					// -->
					//]]>
				</script>
				
				<div id="ToArrange" class="tabContent">
					
					<div class="noticeBlock">
						<div class="operation">
						</div>
						<h3>等待安排期末考试周次</h3>
						<p><span class="img icon16x16 message"></span><em><cfoutput>#academicYear#</cfoutput>-<cfoutput>#academicTerm#</cfoutput></em>学期, 有<em><cfoutput>#rs_courseToDo.recordCount#</cfoutput></em>门课程等待安排考试时间</p>
						<hr/>
					</div>
                         
                          <form id="formSearch" onSubmit="javascript:return processVerfiyForm('formSearch');" class="formWrapper Transparent" method="post" action="<cfoutput>#buildURL('examByDepartment',passArgs)#</cfoutput>">
                                   <input type="hidden" name="TabID" value="labToArrange" />
                                   
                                   <div class="label">
                                        <b>课程名或者教师名字</b>
                                        <input name="Keywords" id="Keywords" type="text" class="typeText" verification="required" maxlength="128" value="<cfoutput>#Keyword#</cfoutput>" />
                                        
                                   </div>
                                   
                                   <div class="label">
                                        <b>选择班级</b>
                                        <select name="CLASS" onchange=this.form.submit()>
                                        	<option selected="selected" value=""></option>
                                        	<cfloop query="rs_class">
                                        		<option value="<cfoutput>#rs_class.cls_name#</cfoutput>"><cfoutput>#rs_class.cls_name#</cfoutput></option>
                                             </cfloop>
                                        </select>
                                   </div>
                                 
                                   <div class="lable">
                                        <input class="button1" type="submit" value="搜索" />
                                   </div>
                                     <hr/>
                              </form>
					
					<cfif rs_courseToDo.recordCount>
						<cfset row = 0 />
						<table class="UIEditable">
							<thead>
								<tr>
									<!---<td width="18"></td>--->
									<td width="18"></td>
                                              <cfif len(className) ><td>班级</td></cfif>
									<td>课程</td>
                                             <td>类型</td>
                                             <td>状态</td>
                                             <td>教师</td>
									<td >人数</td>
									<td>学分</td>
                                             <td width="18"></td>
									<td width="18"></td>
								</tr>
							</thead>
							<tbody>
								<cfloop query="rs_courseToDo">
									<cfset row++ />
									<cfset structInsert(targetArgs, "CID", rs_courseToDo.cid, true) />
									<cfset structInsert(targetArgs, "TT", "p", true) />
									<cfset structInsert(targetArgs, "taskId", rs_courseToDo.tsk_id, true) />
                                             
									<tr class="editRows">
										<!---<td><a title="该门课程不考试" href="<cfoutput>#buildURL('examCourseRemoveDo', passArgs)#</cfoutput>" class="stat remove"></a></td>--->
										<td class="index"><cfoutput>#row#</cfoutput></td>
                                                   <cfif len(className) ><td><cfoutput>#className#</cfoutput></td></cfif>
										<td><cfoutput>#rs_courseToDo.course_name#</cfoutput></td>
                                                  <td><cfif rs_courseToDo.prop_id eq '1' >
                                                  		必修
                                                            <cfelse>
                                                            选修
                                                        </cfif></td>
                                                  <td><cfif rs_courseToDo.isArranged eq '1' or rs_courseToDo.isArranged eq '2'>
                                                  		<font color="red">部分安排</font>
                                                        </cfif></td>
                                                  <td><cfoutput>#rs_courseToDo.tch_name#</cfoutput></td>
										<td align="center"><span class="numeric"><cfoutput>#rs_courseToDo.countEx#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#numberFormat(rs_courseToDo.course_credit, "_.__")#</cfoutput></span></td>
                                                  <td><cfif rs_courseToDo.isArranged eq '1' or rs_courseToDo.isArranged eq '2'><a title="删除课程考试安排" onclick="return checked();" class="stat delete" href="<cfoutput>#buildURL('examTaskDelete', targetArgs)#</cfoutput>"></a></cfif></td>
										<td><a title="安排课程考试时间与地点" href="<cfoutput>#buildURL('examByCourse', targetArgs)#</cfoutput>" class="stat edit"></a></td>
									</tr>
								</cfloop>
							</tbody>
						</table>
						
					</cfif>
					
					
				</div>
				
				
				
				<cfif rs_examTask.recordCount>
					
					<div id="DoneArrange" class="tabContent">
						
						<div class="noticeBlock">
                             
							
                              	<div class="operation">
                                        <a class="uiButton" target="_blank" href="<cfoutput>#buildURL('examClassTaskPrint', passArgs)#</cfoutput>"><i class="mrs img btnPrint"></i><span class="uiButtonText">打印班级必修课考试安排(正考)</span></a>
                                        <a class="uiButton" target="_blank" href="<cfoutput>#buildURL('examAllTaskPrint', passArgs)#</cfoutput>"><i class="mrs img btnPrint"></i><span class="uiButtonText">打印所有考试安排(正考)</span></a>
                                        <a class="uiButton" target="_blank" href="<cfoutput>#buildURL('examSelectTaskPrint', passArgs)#</cfoutput>"><i class="mrs img btnPrint"></i><span class="uiButtonText">打印选修课考试安排(正考)</span></a>
                                   </div>
							 <h3>课程考试周次及分组安排</h3>
                                    <p><span class="img icon16x16 message"></span><em><cfoutput>#academicYear#</cfoutput>-<cfoutput>#academicTerm#</cfoutput></em>学期, 有<em><cfoutput>#rs_examTask.recordCount#</cfoutput></em>场期末考试安排</p>
							<hr/>
						</div>
						
						<cfif rs_examTask.recordCount >
                    	
						    <cfset row = 0 />
                                  <table class="UIEditable">
                                       <thead>
                                            <tr>
                                                 <td width="25"></td>
                                                 <td>课程</td>
                                                 <td>教师</td>
                                                 <td >考场</td>
                                                 <td>考试日期</td>
                                                 <td>考试时间</td>
                                                 <td>类型</td>
                                                 <td >人数</td>
                                                 <td >学分</td>
                                                 <td width="18"></td>
                                                  <td width="18"></td>
                                                 
                                            </tr>
                                       </thead>
                                       <tbody>
                                      
                                          <cfset row = 0 />
                                         <cfloop query="rs_examTask" >
                                            <cfset row ++ />
                                                 <cfset structInsert(passArgs, "taskId", rs_examTask.task_id, true) />
                                                 <cfset structInsert(passArgs, "TT", "p", true) />
                                                  <cfset structInsert(passArgs, "cid", rs_examTask.cid, true) />
                                                 <cfset structInsert(passArgs, "ExamType", "F", true) />
                                                 <tr class="editRows">
                                                      <td class="index"><cfoutput>#row#</cfoutput></td>
                                                      <td><cfoutput>#rs_examTask.course_name#</cfoutput></td>
                                                      
                                                      <td><cfoutput>#rs_examTask.tch_name#</cfoutput></td>
                                                      <td><cfoutput>#rs_examTask.classroom#</cfoutput></td>
                                                      <td><cfoutput>#datetimeAdvice.formatDateString( rs_examTask.date_exam )#</cfoutput></td>
                                                      <td><cfoutput>#datetimeAdvice.formatTimeString(rs_examTask.time_start, 'HH:MI')#</cfoutput> ~ <cfoutput>#datetimeAdvice.formatTimeString(rs_examTask.time_end, 'HH:MI')#</cfoutput></td>
                                                       <td>正常考试</td>
                                                      <td><span class="numeric"><cfoutput>#rs_examTask.task_chooesd#</cfoutput></span></td>
                                                      
                                                    <td><span class="numeric"><cfoutput>#rs_examTask.course_credit#</cfoutput></span></td>
                                                     <td><a title="安排课程考试时间与地点" href="<cfoutput>#buildURL('examByCourse', passArgs)#</cfoutput>" class="stat edit"></a></td>
                                                      <td><a title="删除课程考试安排" onclick="return checked();" class="stat delete" href="<cfoutput>#buildURL('examTaskDelete', passArgs)#</cfoutput>"></a></td>
                                                      
                                                 <!---<td><a title="查看课程考试详细安排" class="stat details" href="<cfoutput>#buildURL('examTaskPrint', passArgs)#</cfoutput>"></a></td>--->
                                                 </tr>
                                            </cfloop>
                                       </tbody>
                                  </table>
                                  
                                  <cfelse>
                                  
                                  <div class="systemNotice">
                                       <p>目前, 您承担的教学任务尚未发布考试安排</p>
                                  </div>
                                  
                             </cfif>
						
					</div>
					
				</cfif>
                    
                    
                    <cfif rs_examTaskAdvice.recordCount>
					
					<div id="DoneArrangeAdvice" class="tabContent">
						
						<div class="noticeBlock">
                              	
                              	<div class="operation">
                                   	<a class="uiButton" target="_blank" href="<cfoutput>#buildURL('examAdviceTaskPrint', passArgs)#</cfoutput>"><i class="mrs img btnPrint"></i><span class="uiButtonText">打印提前考试安排</span></a>
                                   </div>
                                   <h3>课程考试周次及分组安排</h3>
							<p><span class="img icon16x16 message"></span><em><cfoutput>#academicYear#</cfoutput>-<cfoutput>#academicTerm#</cfoutput></em>学期 ,有<em><cfoutput>#rs_examTaskAdvice.recordCount#</cfoutput></em>场提前考试安排</p>
							<hr/>
						</div>
                              
                          
						<cfif rs_examTask.recordCount or rs_examTaskAdvice.recordCount>
                    	
						    <cfset row = 0 />
                                  <table class="UIEditable">
                                       <thead>
                                            <tr>
                                                 <td width="25"></td>
                                                 <td>课程</td>
                                                 <td>教师</td>
                                                 <td >考场</td>
                                                 <td>考试日期</td>
                                                 <td>考试时间</td>
                                                 <td>类型</td>
                                                 <td >人数</td>
                                                 <td >学分</td>
                                                 <td width="45"></td>
                                                 
                                            </tr>
                                       </thead>
                                       <tbody>
                                        <cfloop query="rs_examTaskAdvice" >
                                       <cfset row ++ />
									<cfset structInsert(passArgs, "taskId", rs_examTaskAdvice.task_id, true) />
                                             <cfset structInsert(passArgs, "ExamType", "F", true) />
                                             <tr class="editRows">
                                                  <td class="index"><cfoutput>#row#</cfoutput></td>
                                                  <td><cfoutput>#rs_examTaskAdvice.course_name#</cfoutput></td>
                                                  
                                                  <td><cfoutput>#rs_examTaskAdvice.tch_name#</cfoutput></td>
                                                  <td><cfoutput>#rs_examTaskAdvice.classroom#</cfoutput></td>
                                                  <td><cfoutput>#datetimeAdvice.formatDateString( rs_examTaskAdvice.date_exam )#</cfoutput></td>
                                                  <td><cfoutput>#datetimeAdvice.formatTimeString(rs_examTaskAdvice.time_start, 'HH:MI')#</cfoutput> ~ <cfoutput>#datetimeAdvice.formatTimeString(rs_examTaskAdvice.time_end, 'HH:MI')#</cfoutput></td>
                                                   <td><span style="color:#F0F">提前考试</span></td>
                                                  <td><span class="numeric"><cfoutput>#rs_examTaskAdvice.count#</cfoutput> / <cfoutput>#rs_examTaskAdvice.task_chooesd#</cfoutput></span></td>
                                                  
                                                <td><span class="numeric"><cfoutput>#rs_examTaskAdvice.course_credit#</cfoutput></span></td>
                                                  <td>
                                                  <a title="删除课程考试安排" class="stat delete" onclick="return checked();" href="<cfoutput>#buildURL('examAdviceTaskDelete', passArgs)#</cfoutput>"></a>
                                                  <a title="课程提前考试学生" class="stat info" href="<cfoutput>#buildURL('examAdviceStudent', passArgs)#</cfoutput>"></a>
                                                  </td>
                                             <!---<td><a title="查看课程考试详细安排" class="stat details" href="<cfoutput>#buildURL('examTaskPrint', passArgs)#</cfoutput>"></a></td>--->
                                             </tr>
                                        </cfloop>
                                       
                                       </tbody>
                                  </table>
                                  
                                  <cfelse>
                                  
                                  <div class="systemNotice">
                                       <p>目前, 您承担的教学任务尚未发布考试安排</p>
                                  </div>
                                  
                             </cfif>
						
					</div>
					
				</cfif>
				
                    
                    <div id="AdviceArrange" class="tabContent">
					
					<div class="noticeBlock">
						<div class="operation">
						</div>
						<h3>所有考试课程设置</h3>
						<p><span class="img icon16x16 message"></span><em><cfoutput>#academicYear#</cfoutput>-<cfoutput>#academicTerm#</cfoutput></em>学期, 有<em><cfoutput>#rs_courseAll.recordCount#</cfoutput></em>门课程可以提前安排考试时间</p>
						<hr/>
					</div>
                         
                         <form id="formSearch" onSubmit="javascript:return processVerfiyForm('formSearch');" class="formWrapper Transparent" method="post" action="<cfoutput>#buildURL('examByDepartment',passArgs)#</cfoutput>">
                                   <input type="hidden" name="TabID" value="labAdviceArrange" />
                                   
                                   <div class="label">
                                        <b>课程名或者教师名字</b>
                                        <input name="adviceKeywords" id="adviceKeywords" type="text" class="typeText" verification="required" maxlength="128" value="<cfoutput>#event.getArg('adviceKeywords')#</cfoutput>" />
                                        
                                   </div>
                                   
                                 
                                   <div class="lable">
                                        <input class="button1" type="submit" value="搜索" />
                                   </div>
                                     <hr/>
                              </form>
					
					<cfif rs_courseAll.recordCount>
						<cfset row = 0 />
						<table class="UIEditable">
							<thead>
								<tr>
									<!---<td width="18"></td>--->
									<td width="18"></td>
                                            
									<td>课程</td>
                                             <td>状态</td>
                                             <td>教师</td>
									<td >人数</td>
									<td>学分</td>
                                             <td width="18"></td>
									<td width="18"></td>
                                             <td width="18"></td>
								</tr>
							</thead>
							<tbody>
                                   	
								<cfloop query="rs_courseAll">
									<cfset row++ />
									<cfset structInsert(targetArgs, "CID", rs_courseAll.cid, true) />
									<cfset structInsert(targetArgs, "TT", "p", true) />
									<cfset structInsert(targetArgs, "taskId", rs_courseAll.tsk_id, true) />
                                             
									<tr class="editRows">
										<!---<td><a title="该门课程不考试" href="<cfoutput>#buildURL('examCourseRemoveDo', passArgs)#</cfoutput>" class="stat remove"></a></td>--->
										<td class="index"><cfoutput>#row#</cfoutput></td>
										<td><cfoutput>#rs_courseAll.course_name#</cfoutput></td>
                                                  <td><cfif rs_courseAll.isArranged eq '1' or rs_courseAll.isArranged eq '2'>
                                                  		<font color="red">未安排完成</font>
                                                        <cfelseif rs_courseAll.isArranged eq '3'>
                                                        	已经安排
                                                       </cfif></td>
                                                  <td><cfoutput>#rs_courseAll.tch_name#</cfoutput></td>
										<td align="center"><span class="numeric"><cfoutput>#rs_courseAll.countEx#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#numberFormat(rs_courseAll.course_credit, "_.__")#</cfoutput></span></td>
										<cfif rs_courseAll.isArranged eq '1' or rs_courseAll.isArranged eq '2'><td><a title="删除课程考试安排" onclick="return checked();" class="stat delete" href="<cfoutput>#buildURL('examAdviceTaskDelete', targetArgs)#</cfoutput>"></a></td><cfelse><td></td></cfif>
                                                  <td><a title="安排课程考试时间与地点" href="<cfoutput>#buildURL('examByCourseAdvice', targetArgs)#</cfoutput>" class="stat edit"></a></td>
                                                  
                                                   <td><a title="课程提前考试学生" class="stat info" href="<cfoutput>#buildURL('examAdviceStudent', targetArgs)#</cfoutput>"></a></td>
									</tr>
								</cfloop>
							</tbody>
						</table>
						
					</cfif>
					
					
				</div>
                    
                     <script language="javascript" type="text/javascript">
				
                    	function checked(){
						var msg = "您真的确定要删除吗？\n\n请确认！"; 
						if (confirm(msg)==true){ 
							return true; 
						}else{ 
							return false; 
						} 
					}
                    
                    </script>
				
                    
			
			</div>
		</li>
	</ul>
</div>
			
			
